//
//  XWCellMenuItemButton.m
//  CGWSWW
//
//  Created by lanou3g on 16/8/17.
//  Copyright © 2016年 CXG. All rights reserved.
//

#import "XWCellMenuItemButton.h"
#import "XWCellIconModel.h"
#import "HeadHelp.h"
@implementation XWCellMenuItemButton

- (instancetype)initWithFrame:(CGRect)frame model:(XWCellIconModel *)model
{
    if (self = [super initWithFrame:frame]) {
        [self settingItemButtonWithModel:model];
    }
    return self;
}
- (void)settingItemButtonWithModel:(XWCellIconModel *)model
{
    //图片
    UIImageView *image = [[UIImageView alloc] init];
    image.bounds = CGRectMake(0, 0, 20, 20);
    image.center = CGPointMake(self.frame.size.width/2, 20);
    image.image = [UIImage imageNamed:model.icon];
    [self addSubview:image];
    
    //文案
    UILabel *title = [[UILabel alloc] init];
    title.bounds = CGRectMake(0, 0, self.frame.size.width, 20);
    title.center = CGPointMake(self.frame.size.width/2, self.frame.size.height - title.frame.size.height/2+ 4);
    title.text = model.title;
    title.textAlignment = NSTextAlignmentCenter;
    title.font = XWSmallFont;
    title.textColor = XWMainColor;
    [self addSubview:title];
}



@end
